home *** CD-ROM | disk | FTP | other *** search
- (C) Copyright Aspen Scientific. All rights reserved.
-
- // test program for the OS/2 date and time classes
- //
- // compile/link with OASYS: ccxx dt.cxx datetime.cxx
-
- #define INCL_DOSPROCESS // directs os2 header definitions
- #include <os2.h>
- #include <stream.hxx>
- #include "datetime.hxx"
-
- // program start-up
-
- int main()
- {
- DateAndTime Then;
- cout << "Then: " << Then.Show();
-
- // go inactive for 1000 milliseconds, or one second
- DosSleep( 1000L );
-
- DateAndTimePlus Now(1, 1);
- cout << "Now : " << Now.Show();
-
- // show the date and time separately
- cout << "Date: " << Now.ShowDate() << "Time: " << Now.ShowTime();
-
- // now use the newly available routines from the
- // derived class DateAndTimePlus
-
- cout << "Hour: " << Now.GetHours() << "\n";
- cout << "Min : " << Now.GetMinutes() << "\n";
- cout << "Sec : " << Now.GetSeconds() << "\n";
- cout << "Hund: " << Now.GetHundredths() << "\n";
- cout << "Day : " << Now.GetDay() << "\n";
- cout << "Mon : " << Now.GetMonth() << "\n";
- cout << "Year: " << Now.GetYear() << "\n";
- cout << "Zone: " << Now.GetTimeZone() << "\n";
- cout << "WDay: " << Now.GetWeekDay() << "\n";
-
- exit( 0 );
- }